We now have a lint rule to disallow lonely ifs, however there are
cases where the "lonely" part mirrors code from the preceding if
clause. Opt out of the lint rule in those cases.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818
});
}
} else {
+ // eslint-disable-next-line no-lonely-if
if (!this.hasPendingMessages) {
this._cancelAndReset();
} else {
format = N_("%B %-d %Y, %H\u2236%M");
} else {
// Show only the time if date is on today
- if (daysAgo < 1 || params.timeOnly)
+ if (daysAgo < 1 || params.timeOnly) // eslint-disable-line no-lonely-if
/* Translators: Time in 12h format */
format = N_("%l\u2236%M %p");
// Show the word "Yesterday" and time if date is on yesterday
this.addCrosshairs();
this._crossHairs.show();
} else {
+ // eslint-disable-next-line no-lonely-if
if (this._crossHairs)
this._crossHairs.hide();
}
}
}
} else {
+ // eslint-disable-next-line no-lonely-if
if (this._modal) {
Main.popModal(this._overview);
this._modal = false;
else if (wpaFlags & NM80211ApSecurityFlags.KEY_MGMT_PSK)
type = NMAccessPointSecurity.WPA_PSK;
} else {
+ // eslint-disable-next-line no-lonely-if
if (flags & NM80211ApFlags.PRIVACY)
type = NMAccessPointSecurity.WEP;
else
else
direction = Meta.MotionDirection.LEFT;
} else {
- if (vertical)
+ if (vertical) // eslint-disable-line no-lonely-if
direction = Meta.MotionDirection.DOWN;
else if (rtl)
direction = Meta.MotionDirection.LEFT;